import request ,{ get, post, postUpload, postFormData } from '@/utils/request'

// 上传
export const uploadFile = (file) => postUpload('/common/interface/upload_img', file)
export const importFile = (url, file) => postUpload(url, file)
export const exportFile = (url) => request({
  url,
  method: 'get',
  responseType: 'blob',
})
// 首页
export const http = {
  getMeetingType:  () => get('/GlProject/selectMeetingType'),
  projectIns: () => get('/GlProject/selectMeetingLeader'),
  home: {
    top: () => postFormData('/HomePage/fourBlock'),
    project: () => postFormData('/HomePage/getRecentProjects'),
    table: () => postFormData('/HomePage/ProjectStatistics'),
    meetingSum: () => post('/HomePage/MeetingOrganization'),
    meetingUser: () => post('/HomePage/ExpertsNumber'),
    SavingList: () => get('/HomePage/costSavingStatistics'),

  },
  projectStatic: {
    top: () => post('/summaryStatistics/fourBlock'),
    deptCount: () => post('/summaryStatistics/OrganizationQuantity'),
    meetingJoinRate: () => post('/summaryStatistics/unitParticipationRate'),
    meetingJoinUser: () => post('/HomePage/ExpertsNumber'),
    meetingJoinMoney: () => post('/summaryStatistics/savingCapital'),
    meetingJoinDept: () => post('/summaryStatistics/participant'),
    card: () => post('/summaryStatistics/DisposalTimeStatistics')
  },
  project_center: {
    page: (data) => postFormData('/GlProject/getProjectCenter', data),
    read: (data) => postFormData('/GlProject/getProjectCenterById', data),
    create: (data) => post('/GlProject/addProject', data),
    getSavingCapital: (data) => get('/GlProject/calculatedSavings', data),
    update: (data) => post('/Review/addProject', data),
    updateStatus: (data) => post('/Review/updateProjectExamine', data),
    personal1List: (projectId) => postFormData('/zgProject/selectPeopleInvolvement', { projectId }),
    personal2List: (projectId) => postFormData('/zgProject/selectParticipatingDepartments', { projectId }),
    sendCloud: (data) => post('/cloudReview/sendMessage', data),
    getids: (data) => postFormData('/cloudReview/getParExpert', data),
    delete: (data) => post('/GlProject/delProject', {id:data})
  },
  // 管理端项目
  admin_project_center: {
    create: (data) => post('/GlProject/addProject', data),
    getSavingCapital: (data) => get('/GlProject/calculatedSavings', data),
  },
  // 会议申请
  meeting_apply: {
    page: (data) => postFormData('/Review/selectMeetApplication', data),
    updateMeeting: (data) => post('/zgProject/updateMeeting', data),
    hangye: () => postFormData('/zgProject/selectBusiness'),
    zhineng: () => postFormData('/zgProject/selectFunction'),
    delete: (id) => get('/Review/concludeMeeting', { id, isDelete: -1 }),
    professorList: (data) => postFormData('/zgProject/selectExpertMessage', data),
    professorListSave: (data) => post('/zgProject/personnelConfirmation', data),
    deptList: (data) => get('/zgProject/selectDepartmentExpert', data),
    deptListSave: (data) => post('/zgProject/departmentConfirmation', data),
    professor_accept: (projectId) => postFormData('/zgProject/selectSocietySpecialist', { projectId }),
    dept_accept: (projectId) => get('/zgProject/selectDepartmentSpecialist', { projectId }),
    del_professor_accept: (data) => postFormData('/zgProject/delSocietySpecialist', data),
    del_dept_accept: (data) => post('/zgProject/delSocietySpecialist', data),

    invite: (data) => post('/sendMsg/sendNotice', data)
  },
  // 会议进程
  meeting_process: {
    page: (data) => postFormData('/Review/selectMeetCourse', data),
    professorList: (data) => postFormData('/zgProject/selectSocialExpert', data),
    professorListSave: (data) => post('/zgProject/personnelConfirmation', data),
    deptList: (data) => get('/zgProject/selectDepartmentExpert', data),
    validateDeptUser: (data) => post('/zgProject/addAccountToDepart', data),
    delDeptUser: (data) => post('/zgProject/deleteAccountToDepart', data),
    deptListSave: (data) => post('/zgProject/departmentConfirmation', data),
    professor_accept: (projectId) => postFormData('/zgProject/selectSocietySpecialist', { projectId }),
    dept_accept: (projectId) => get('/zgProject/selectDepartmentSpecialist', { projectId }),
    del_professor_accept: (data) => post('/zgProject/delSocietySpecialist', data),
    del_dept_accept: (data) => post('/zgProject/delSocietySpecialist', data),

    signList: (projectId) => postFormData('/zgProject/meetingSignature', { projectId }),
    sendAccountProfessor: (data) => post('/zgProject/expertAccountRelease', { ids: data }),
    sendAccountDept: (data) => post('/zgProject/departmentExpertRelease', { ids: data }),
    startMeeting: (projectId) => postFormData('/thirdMeeting/startMeeting', { projectId }),
  },
  // 会议纪要
  meeting_record: {
    create: (data) => post('/Review/addSummary', data),
    raed: (projectId) => get('/Review/summaryInquire', { projectId })
  },
  // 会议评审
  meeting_comment: {
    professor_page: (data) => postFormData('/zgProject/selectExpertReviewOpinion', data),
    dept_page: (data) => postFormData('/engineering/selectOpinionsOfConstructionUnits', data),
    create: (data) => postFormData('/Review/MeetingOpinion', data),
    download: (data) => get('/GlProject/selectReviewerComment', data),
  },
  // 会议室
  meetingRoom: {
    list: (data) => postFormData('/zgProject/conferenceInfoList', data),
    statusList: (data) => postFormData('/Review/supplemental', data),
    create: (data) => post('/zgProject/confirmConference', data)
  },
  // 会议资料
  meeting_data: {
    list: (data) => postFormData('/Review/getFileLogin', data),
    fileList: (id) => get('/Review/getFileLoginById', { id }),
    create: (data) => post('/qyProject/addProjectFile', data),
  },
  // 评审
  review: {
    create: (data) => post('/qyProject/addProject', data)
  },
  // 专家
  professor: {
    page: (data) => postFormData('/ExpertWarehouse/getExpertWarehouse', data),
    create: (data) => post('/ExpertWarehouse/addExpertWarehouse', data),
    update: (data) => post('/ExpertWarehouse/updateExpertWarehouse', data),
    delete: (id) => post('/ExpertWarehouse/delExpertWarehouse', { id, isDelete: -1 }),
    import: (data) => post('/ExpertWarehouse/inExpertWarehouse', data),
    export: (data) => post('/ExpertWarehouse/outExpertWarehouse', data),
    commentList: (data) => postFormData('/ExpertWarehouse/getReviewRecord', data),
    read: (id) => postFormData('/ExpertWarehouse/getExpertWarehouseById', { id }),
    hangye: () => postFormData('/ExpertWarehouse/getExpertIndustry')
  },
  // 单位
  dept: {
    page: (data) => postFormData('/sysDepart/getSysDepart', data),
    list: (data) => postFormData('/sysDepart/getDepartList', data),
    create: (data) => post('/sysDepart/addSysDepart', data),
    update: (data) => post('/sysDepart/updateSysDepart', data),
    delete: (id) => post('/sysDepart/delSysDepart', { id, isDelete: -1 }),
    createch: (data) => post('/sysDepart/addSysDepartLv2', data),
  },
  // 单位人员
  dept_user: {
    page: (data) => postFormData('/sysDepartPeople/getDepartPeople', data),
    create: (data) => post('/sysDepartPeople/addDepartPeople', data),
    update: (data) => post('/sysDepartPeople/updateDepartPeople', data),
    delete: (id) => post('/sysDepartPeople/delDepartPeople', { id, isDelete: -1 })
  },
  // 用户
  user: {
    page: (data) => postFormData('/User/getUser', data),
    create: (data) => post('/User/addUser', data),
    update: (data) => post('/User/updateUser', data),
    updateStatus: (data) => post('/User/updateUserStatus', data),
    updatePassword: (data) => post('/User/updateUserPassword', data),
    delete: (id) => post('/User/delUser', { id, isDelete: -1 })
  },
  // 权限
  permission: {
    list: () => postFormData('/Jurisdiction/getPower'),
    update: (data) => post('/User/updateUserPower', data),
    read: (userId) => postFormData('/User/selectUserPower', { userId })
  },
  // 日志
  log: {
    loginLog: (data) => postFormData('/UserLogin/getUserLogin', data),
    handleLog: (data) => postFormData('/UserLogin/getUserOperation', data)
  },
  // 企业
  enterprise: {
    page: (data) => postFormData('/businessAdministration/selectEnterprise', data),
    auditPage: (data) => postFormData('/businessAdministration/selectEnterpriseAuditList', data),
    updateStatus: (data) => post('/businessAdministration/updateAuditStatus', data),
    historyPage: (data) => postFormData('/businessAdministration/selectUploadHistory', data),
    categoryList: () => postFormData('/businessAdministration/selectTypeOfEnterprise'),
    update: (data) => post('/businessAdministration/updateEnterprise', data),
    create: (data) => post('/businessAdministration/addEnterprise', data),
    delete: (id) => post('/businessAdministration/delEnterpriseState', { id, isDelete: -1 }),
    createself: (data) => post('/businessAdministration/addEnter', data)
  },
  // 企业账户
  enterpriseAccount: {
    page: (data) => postFormData('/businessAdministration/selectCorporateAccountInfo', data),
    distribute: (data) => post('/businessAdministration/insertIssueAccountNumber', data),
    update: (data) => post('/businessAdministration/updateCorporateAccount', data),
    updateStatus: (data) => post('/businessAdministration/updateUserState', data),
    read: (id) => postFormData('/businessAdministration/selectCorporateAccountDetails', { enterpriseId: id })
  },
  // 企业端项目中心
  enterprise_project: {
    page: (data) => postFormData('/qyProject/selectProject', data),
    create: (data) => post('/qyProject/addProject', data),
    data_upload: (data) => post('/qyProject/addProjectFile', data),
    file_upload: (data) => post('/qyProject/selectFilesUploadRecord', data)
  },
  // 企业端工程中心
  enterprise_engineering: {
    page: (data) => postFormData('/qyProject/selectEngineering', { ...data }),
    create: (data) => post('/qyProject/addProject', { ...data, category: 2 })
  },
  // 管理端工程中心
  admin_engineering: {
    page: (data) => postFormData('/zgProject/selectProject', data),
    updateStatus: (data) => post('/zgProject/updatePassTheAudit', data),
    read: (id) => postFormData('/zgProject/selectProjectDetails', { id }),
    build_dept: (data) => postFormData('/engineering/selectOrganizationOfConstructionUnit', data),
    build_info: (data) => postFormData('/engineering/selectDevelopmentOrganizationParticipation', data),
    build_comment: (data) => postFormData('/engineering/selectOpinionsOfConstructionUnits', data),
    build_comment_create: (data) => post('/engineering/updatePreparationOfMeetingMinutes', data)
  },
  // 管理端工程中心会议
  admin_engineering_meeting: {
    page: (data) => postFormData('/zgProject/selectMeetingProject', data)
  },
  // 邀请
  meeting_invites: {
    detail: (data) => postFormData('/sendMsg/getMeetingDetail', data),
    tomeet: (data) => post('/sendMsg/submitMeeting', data),
    departmentList: (data) => postFormData('/sendMsg/getDepartListByTopId', data),
    tomeetList: (data) => post('/sendMsg/submitJoinMeeting', data),
    peopleList: (data) => postFormData('/sendMsg/getJoinPeopleList', data),
  }
}

